from django.db import models
from datetime import datetime
from teams.models import Team
from django.db.models.fields import CharField, IntegerField, TextField

# Create your models here.
class Player(models.Model):
    #所属球队
    team = models.ForeignKey(Team, on_delete=models.DO_NOTHING)
    teamid = models.CharField(max_length=100)
    is_east = models.BooleanField(default=True)
    is_west = models.BooleanField(default=True)
    name = models.CharField(max_length=100)
    score = models.CharField(max_length=100)
    time = models.CharField(max_length=100)
    percentage = models.CharField(max_length=100)
    shoot = models.CharField(max_length=100)
    hit = models.CharField(max_length=100)
    threepercentage = models.CharField(max_length=100)
    threeshoot = models.CharField(max_length=100)
    threehit = models.CharField(max_length=100)
    rebound = models.CharField(max_length=100)
    assists = models.CharField(max_length=100)
    turnover = models.CharField(max_length=100)
    foul = models.CharField(max_length=100)
    is_published = models.BooleanField(default=True)
        
    photo_main = models.ImageField(upload_to='photos/%Y/%m/%d/')
    

    def __str__(self):
        return self.score